﻿namespace MultipleMonitorVideo.Utilities
{
    using System;
    using System.Windows.Forms;

    public static class ScreenManager
    {
        private static readonly Screen[] Screens = Screen.AllScreens;

        public static Screen GetPrimaryScreen()
        {
            return ScreenManager.GetScreen(0);
        }

        public static Screen GetSecondaryScreen()
        {
            return ScreenManager.GetScreen(1) ?? ScreenManager.GetScreen(0);
        }

        public static Screen[] GetScreens()
        {
            return ScreenManager.Screens;
        }

        public static Screen GetScreen(int screenNum)
        {
            return screenNum < ScreenManager.Screens.Length
                ? ScreenManager.Screens[screenNum]
                : null;
        }
    }
}
